sap.ui.define([
    "sap/ui/core/mvc/Controller",
    "sap/m/MessageToast"
 ], (Controller, MessageToast) => {
    "use strict";
 
    return Controller.extend("ui5.walkthrough.controller.HelloPanel", {
         onNestShowButtonPress() {
          // show message
            const oBundle = this.getView().getModel("i18n").getResourceBundle();
            MessageToast.show(oBundle.getText("helloPanelAlert"));
         },

         // 弹出dialog
         onButtonOpenDialogPress() {
            // 判断是否有pDialog这个变量
            this.pDialog ??= this.loadFragment({
               name: "ui5.walkthrough.view.dialog.HelloDialog",
               Controller: this
            });
            this.pDialog.then((oDialog) => oDialog.open());
         },

         onCloseTheDialog() {
            this.byId("helloDialog").close();
         },

		onGoTableButtonPress: function(oEvent) {
			const oRouter = this.getOwnerComponent().getRouter();
         oRouter.navTo("table");
		}
    });
 });